<!--建立考核模板首页 -->
<template>
  <div>
    <div v-if="!createThree3">
      <div v-if="!createThree2">
        <div style="height: 700px; margin: 25px">
          <el-card class="ensemble" shadow="always">
            <el-row style="display:flex; width:100%;">
              <el-button icon="el-icon-arrow-left" size="small" @click="returns()"
                style="background: #E6E6E6;margin-top:-0.7%">返回</el-button>
            </el-row>
          </el-card>
          <el-card>
            <!-- 考核模板 -->
            <el-row class="createMUban" v-if="!looks">
              <div style="width:400px"></div>
              <div style="margin-left:40%">
                <el-form style="display:flex;">
                  <el-form-item label="姓名">
                    <el-input style="width:75%; height: 32px;" placeholder="请输入" v-model="names"></el-input>
                  </el-form-item>

                  <el-form-item label="状态">
                    <el-select style="width:75%; height: 32px;" v-model="statusd" clearable>
                      <el-option label="未审批" :value="0" style="color: #EF7045"></el-option>
                      <el-option label="已审批" :value="1"></el-option>
                      <!-- <el-option label="审批中" :value="2" style="color: #35A06D"></el-option> -->
                    </el-select>
                  </el-form-item>

                  <!--   @click="sousuo" -->
                  <el-button @click="sousuo()" type="primary"
                    style="height:32px; padding:8px 20px;margin-top:4px">搜索</el-button>
                </el-form>
              </div>
            </el-row>

            <!-- 表格信息 -->
            <el-row>
              <el-table :data="tableData" style="width: 100%; color: #333333;font-size: 14px" height="700" align="center"
                :header-cell-style="{ background: '#ECF1F9' }">
                <el-table-column fixed type="index" align="center" label="序号" width="80"></el-table-column>
                <el-table-column prop="createBy" align="center" label="申请人"></el-table-column>
                <el-table-column prop="examineYear" align="center" label="申请年度">
                  <template slot-scope="scope">
                    <span>{{ getFormatedTimeStr(scope.row.year) }}</span>
                  </template>
                </el-table-column>

                <el-table-column prop="createTime" align="center" label="申请日期">
                  <template slot-scope="scope">
                    <span>{{ scope.row.createTime == null ? '-' : formatYearMonthDay(scope.row.createTime) }}</span>
                  </template>
                </el-table-column>
                <el-table-column prop="examineSubject" align="center" label="申请详情">
                  <template slot-scope="scope">
                    <a @click="openPeopleList(scope.row)">
                      <i>
                        <img src="@/assets/kaohePng/yanJing.png" />
                      </i>
                    </a>
                  </template>
                </el-table-column>

                <el-table-column prop="approveStatus" align="center" label="审核状态">
                  <template slot-scope="scope">
                    <span v-if="scope.row.approveStatus == 0" style="color: #EF7045">未审批</span>
                    <span v-if="scope.row.approveStatus == 1">已审批</span>
                  </template>
                </el-table-column>

                <el-table-column prop="approveResult" align="center" label="结果">
                  <template slot-scope="scope">
                    <span v-if="scope.row.approveResult == 0" style="color: #35A06D">已通过</span>
                    <span v-if="scope.row.approveResult == 1" style="color: #EF7045">已驳回</span>
                    <span v-if="scope.row.approveResult == null">-</span>
                  </template>
                </el-table-column>
                <el-table-column prop="examineScore" align="center" label="得分">
                  <template slot-scope="scope">
                    <span>{{ scope.row.examineScore !== null ? scope.row.examineScore : '-' }}</span>
                  </template>
                </el-table-column>
                <el-table-column fixed="right" align="center" label="操作" width="120">
                  <template slot-scope="scope">
                    <el-button v-if="scope.row.approveStatus == 0 ? true : false" type="text" size="small"
                      style="color: #35A06D" @click.native.prevent="add(scope.row)">通过</el-button>
                    <el-button v-if="scope.row.approveStatus == 0 ? true : false"
                      @click.native.prevent="returnRow(scope.row)" type="text" size="small"
                      style="color:#E86565">驳回</el-button>
                    <el-button v-if="scope.row.approveStatus !== 0 && scope.row.approveResult == 0 ? true : false"
                      type="text" size="small" style="color: #35A06D"
                      @click.native.prevent="lookRow1(scope.row)">查看意见</el-button>
                    <el-button v-if="scope.row.approveStatus !== 0 && scope.row.approveResult == 1 ? true : false"
                      type="text" size="small" style="color: #35A06D"
                      @click.native.prevent="lookRow2(scope.row)">查看原因</el-button>
                    <!-- <el-button
                      v-if="scope.row.status=='CANCEL'?true:false"
                      type="text"
                      size="small"
                      style="color:#ccc"
                    >已撤销</el-button>-->
                    <!-- <el-button
                      v-if="scope.row.status=='NOT_START' || scope.row.status=='CANCEL'?true:false"
                      @click.native.prevent="deleteRow(scope.row)"
                      type="text"
                      size="small"
                      style="color:#E86565"
                    >删除</el-button>-->
                  </template>
                </el-table-column>
              </el-table>
              <el-row>
                <el-pagination style="text-align: right;margin-top:16px" background @size-change="handleSizeChange"
                  @current-change="handleCurrentChange" :current-page="pageNum" :page-sizes="[5, 10]"
                  :page-size="pageSize" layout="sizes, prev, pager, next, jumper" :total="total"></el-pagination>
              </el-row>
            </el-row>
          </el-card>
        </div>
      </div>
    </div>

    <!-- 上报科研成果 -->
    <el-dialog :append-to-body="true" title="上报科研成果" :visible.sync="Release" width="45%" v-if="Release"
      @close="closeTargets()">
      <el-row>
        <p style="font-weight:800;font-size:14px">
          申请年度:
          <span style="color:#999999 ">{{ getFormatedTimeStr(year) }}</span>
        </p>
      </el-row>
      <el-row>
        <el-form size="small">
          <el-form-item prop="servin">
            <template>
              <!--  :row-class-name="rowClassName" -->
              <el-table ref="table" border :data="applayList[0].data" style="width: 100%;margin-top:10px">
                <el-table-column label="序号" align="center" width="55" prop="xh" type="index"></el-table-column>
                <el-table-column prop="examineAchievementType" label="成果类型">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.examineAchievementType"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="examineAchievementName" label="成果名称">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.examineAchievementName"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="doc" label="附件" align="center">
                  <template slot-scope="scope">
                    <el-upload multiple :on-remove="handleRemove1" :headers="upload.headers" :action="upload.action"
                      :on-success="uploadAttachSuccess">
                      <el-button size="mini" style="border:none; background:rgba(0, 0, 0, 0);" plain
                        @click="upLoad(scope.row)">上传附件</el-button>
                    </el-upload>
                    <!-- <el-input v-if="!scope.row.level?true:false" v-model="scope.row.url"></el-input> -->
                  </template>
                </el-table-column>
                <el-table-column label="操作" width="80">
                  <template slot-scope="scope">
                    <el-button @click.native.prevent="applaydeleteRow(scope.$index, applayList)"
                      size="small">移除</el-button>
                  </template>
                </el-table-column>
              </el-table>

              <el-row style="border:0;">
                <el-col style="text-align:center;">
                  <el-button style="border-top:none;width:100px; position: relative;bottom:2px"
                    @click="applayaddRow(applayList)">+</el-button>
                </el-col>
              </el-row>
            </template>
          </el-form-item>
        </el-form>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeTargets()" style="
               background-color: rgba(213, 215, 220);
                height: 30px;
              line-height: 5px;
                ">取 消</el-button>
        <el-button type="primary" @click="submitForm()" style="
             background-color: rgb(76 106 248);
            height: 30px;
               line-height: 5px;
                ">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 查看科研申请详情 -->
    <el-dialog :append-to-body="true" title="申请详情" :visible.sync="Release1" width="45%" @close="closeTargets"
      v-if="Release1">
      <el-row>
        <p style="font-weight:800;font-size:14px">
          申请年度:
          <span style="color:#999999 ">{{ getFormatedTimeStr(year) }}</span>
        </p>
      </el-row>
      <el-row>
        <el-form size="small">
          <el-form-item prop="servin">
            <template>
              <!--  :row-class-name="rowClassName" -->
              <el-table ref="table" border :data="applayList[0].data" style="width: 100%;margin-top:10px">
                <el-table-column label="序号" align="center" width="55" prop="xh" type="index"></el-table-column>
                <el-table-column prop="examineAchievementType" label="成果类型">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.examineAchievementType" :readonly="true"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="examineAchievementName" label="成果名称">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.examineAchievementName" :readonly="true"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="doc" label="附件" align="center">
                  <template slot-scope="scope">
                    <el-upload multiple disabled :on-remove="handleRemove1" :headers="upload.headers"
                      :action="upload.action" :on-preview="preview" :on-success="uploadAttachSuccess"
                      :file-list="UploadedfileList[scope.row.id - 1]">
                      <el-button v-if="btnShow" size="mini" style="border:none; background:rgba(0, 0, 0, 0);" plain
                        @click="upLoad(scope.row)">上传附件</el-button>
                    </el-upload>
                    <!-- <el-input v-if="!scope.row.level?true:false" v-model="scope.row.url"></el-input> -->
                  </template>
                </el-table-column>
                <el-table-column label="操作" width="80" v-if="btnShow">
                  <template slot-scope="scope">
                    <el-button @click.native.prevent="applaydeleteRow(scope.$index, applayList)"
                      size="small">移除</el-button>
                  </template>
                </el-table-column>
              </el-table>

              <el-row style="border:0;">
                <el-col style="text-align:center;">
                  <el-button v-if="btnShow" style="border-top:none;width:100px; position: relative;bottom:2px"
                    @click="applayaddRow(applayList)">+</el-button>
                </el-col>
              </el-row>
            </template>
          </el-form-item>
        </el-form>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button v-if="btnShow" @click="closeTargets()" style="
               background-color: rgba(213, 215, 220);
                height: 30px;
              line-height: 5px;
                ">取 消</el-button>
        <el-button v-if="btnShow" type="primary" @click="submitForm()" style="
             background-color: rgb(76 106 248);
            height: 30px;
               line-height: 5px;
                ">确 定</el-button>
      </span>
    </el-dialog>

    <!-- 通过与驳回 -->
    <el-dialog :append-to-body="true" :title="titleMap1[dialogStatus]" :visible.sync="Release2" width="25%"
      @close="closeTargets2" v-if="Release2">
      <el-row>
        <el-form label-width="80px" :model="formLabelAlign">
          <el-form-item label="打分:" v-if="titleMap1[dialogStatus] == '通过'">
            <el-input v-model="formLabelAlign.num" style="width:80%" type="number"
              oninput="if(!/^[0-9]+$/.test(value)) value=value.replace(/\D/g,'');if(value>100)value=100;if(value<0)value=null"></el-input>
          </el-form-item>
          <el-form-item label="意见:" v-if="titleMap1[dialogStatus] == '通过'">
            <el-input v-model="formLabelAlign.yijian" type="textarea" :rows="5" style="width:80%"></el-input>
          </el-form-item>
          <el-form-item label="驳回原因:" v-if="titleMap1[dialogStatus] == '驳回'">
            <el-input v-model="formLabelAlign.yuanyin" type="textarea" :rows="5" style="width:80%"></el-input>
          </el-form-item>
        </el-form>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeTargets2()" style="
               background-color: rgba(213, 215, 220);
                height: 30px;
              line-height: 5px;
                ">取 消</el-button>
        <el-button v-if="titleMap1[dialogStatus] == '通过' ? true : false" type="primary" @click="submitForm2()" style="
             background-color:#35A06D;
            height: 30px;
               line-height: 5px;
                ">通过</el-button>
        <el-button v-if="titleMap1[dialogStatus] == '驳回' ? true : false" type="danger" @click="submitForm3()" style="
            height: 30px;
               line-height: 5px;
                ">驳回</el-button>
      </span>
    </el-dialog>
    <!-- 查看意见与原因 -->
    <el-dialog :append-to-body="true" :title="titleMap3[dialogStatus3]" :visible.sync="Release3" width="25%"
      @close="closeTargets3" v-if="Release3">
      <el-row>
        <el-form label-width="80px" :model="formLabelAlign">
          <el-form-item label="意见:" v-if="titleMap3[dialogStatus3] == '意见'">
            <el-input v-model="formLabelAlign.yijian" type="textarea" :rows="5" :readonly="true"
              style="width:80%"></el-input>
          </el-form-item>
          <el-form-item label="驳回原因:" v-if="titleMap3[dialogStatus3] == '原因'">
            <el-input v-model="formLabelAlign.yuanyin" type="textarea" :rows="5" :readonly="true"
              style="width:80%"></el-input>
          </el-form-item>
        </el-form>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeTargets3()" style="
               background-color: rgba(213, 215, 220);
                height: 30px;
              line-height: 5px;
                ">关 闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import moment from "moment";
import { serverUrl } from "@/look";
import { Base64 } from "js-base64";
import {
  deletePeople,
  getShenBao,
  addShenBao,
  editShenBao,
  returnShenBao,
  deleteShenBao,
  getShenBaoTime,
  getTianBao,
  addTianBao,
  getGuanLi,
  tongGuanLi,
  returnGuanLi
} from "@/api2/keyan"; //
import { getUserId } from "@/api2/kaohe"; //
import { getToken } from "@/utils/auth";

const base_url = process.env.VUE_APP_BASE_APITwo;
export default {
  props: ["dataTypes1"],
  data() {
    return {
      formLabelAlign: { num: "", yijian: "", yuanyin: "" },
      names: "",
      titleMap1: { addEquipment: "通过", editEquipment: "驳回" },
      dialogStatus: "",
      titleMap3: { addEquipment: "意见", editEquipment: "原因" },
      dialogStatus3: "",
      shenPi: this.dataTypes1,
      btnShow: false,
      UploadedfileList: [],
      upload: {
        headers: { Authorization: getToken(), platform: 'WEB' },
        action: base_url + "/common/upload"
      },
      urls: "",
      Release2: false,
      Release3: false,
      titlesShow: false,
      Release: false,
      Release1: false,
      createThree2: false,
      createThree3: false,
      ruleForm: {
        examineSubject: "",
        startTime: "",
        endTime: "",
        year: ""
      },
      opens: true,
      applayList: [
        {
          approveResult: "",
          approveStatus: "",
          content: "",
          examineScore: "",
          examineYear: "",
          data: [
            {
              id: 1,
              examineAchievementName: "",
              examineAchievementType: "",
              examineAppendixUrl: []
            }
          ]
        }
      ],
      pickerOptions: {
        disableDate: time => {
          return time.getTime() > Date.now();
        }
      },
      dialogStatus: "",
      titleMap: { addEquipment: "发布考核通知", editEquipment: "编辑考核通知" },
      //规则校验
      rules: {
        //指标名称校验
        year: [{ required: true, message: "年份必选", trigger: "change" }],
        examineSubject: [
          { required: true, message: "请输入主题", trigger: "blur" },
          { min: 1, max: 30, message: "长度在 1 到 30个字符", trigger: "blur" }
        ],
        startTime: [
          { required: true, message: "考核开始时间必选", trigger: "change" }
        ],
        endTime: [
          { required: true, message: "考核截止时间必选", trigger: "change" }
        ]
      },
      opensid: "",
      titles: "", //申报名称
      years: "",
      year: "",
      statusd: "",
      ids: "",
      personTechnicalList: "", //职称列表
      nameList: "",
      centerDialogVisible1: false,
      deletes: true,
      multipleSelectionDepartment: [], // 用于保存选中的行
      dataTypes: {},
      nameList: [],
      times: "",
      assessUserTypes: "",
      centerDialogVisible: false,
      looks: false,
      tableDatadialog: [], //表格数据
      createThree: false, //按钮的开关
      formLabelWidth: "120px", //label-width
      pageNum: 1, //当前页
      total: 0, //总条数
      pageSize: 10, //当前页容量
      tableData: [],
      userList: []
    };
  },
  created() {
    this.getList(this.shenPi); //获取表格数据
    this.getShenBaoTimes(); //获取表格数据
  },
  methods: {

    //preview
    preview(e) {
      window.open(
        serverUrl +
        "onlinePreview?url=" +
        encodeURIComponent(Base64.encodeURI(e.urld))
      );
    },
    //返回
    returns() {
      this.$emit("fatherMethod2", false);
    },
    //申请详情
    openPeopleList(e) {
      this.applayList[0].approveResult = e.approveResult;
      this.applayList[0].approveStatus = e.approveStatus;
      this.applayList[0].content = e.content;
      this.applayList[0].examineScore = e.examineScore;
      this.applayList[0].examineYear = e.examineYear;
      this.applayList[0].data = JSON.parse(e.examineAchievementName);
      this.Release1 = true;
      JSON.parse(e.examineAchievementName).forEach(item => {
        console.log(item);
        this.UploadedfileList.push(item.examineAppendixUrl);
      });
      console.log(this.UploadedfileList);
    },
    //添加表格里的行(申请状态)
    applayaddRow(tableData1) {
      console.log(tableData1);
      tableData1.forEach(item => {
        item.data.push({
          examineAchievementName: "",
          examineAchievementType: "",
          examineAppendixUrl: [],
          id: item.data[item.data.length - 1].id + 1
        });
      });
      console.log(tableData1);
    },
    //删除表格里的行(申请状态)
    applaydeleteRow(index, rows) {
      console.log(index, rows);
      rows.forEach(item => {
        if (item.data) {
          item.data.forEach(items => {
            if (items.id == index) {
              if (item.data.length > 1) {
                item.data.splice(item.data.length - 1);
              } else {
                this.$message.error("至少保留一项!");
              }
            }
          });
        }
      });
    },
    //附件
    handleRemove1(file, fileList) {
      console.log(fileList);
      this.applayList.forEach(item => {
        if (item.data) {
          item.data.forEach(res => {
            res.examineAppendixUrl = fileList;
            res.examineAppendixUrl.forEach(res1 => {
              fileList.forEach(items => {
                console.log(items);
                if (items && items.url !== res1.urld) {
                  res.examineAppendixUrl.filter(res1 => res1.urld);
                }
              });
            });
          });
        }
      });

      console.log(this.ruleForm.personSpecialFundProject);
    },
    upLoad(row) {
      console.log(row);
      this.urls = row;
    },
    uploadAttachSuccess(res, file) {
      console.log(res, file);
      if (res.code !== 0) {
        return this.$message.error(res.message);
      }
      this.applayList.forEach(item => {
        if (item.data) {
          item.data.forEach(items => {
            if (items.id == this.urls.id) {
              items.examineAppendixUrl.push({
                name: file.name,
                urld: file.response.data.url
              });
            }
          });
        }
      });
      // this.ruleForm1.attaches.push(res.data);
      //   this.personSpecialFundProject.url.push();
    },
    async getShenBaoTimes() {
      const res = await getShenBaoTime();
      console.log(res);
      if (res.code == 0) {
        this.titlesShow = true;
        this.opens = false;
        this.year = res.data.year;
        this.opensid = res.data.id;
        this.titles = res.data.examineSubject + "已开始";
      } else {
        this.titlesShow = false;
        this.opens = true;
      }
    },
    // 获取格式化时间字符串
    getFormatedTimeStr(stamp, str = "YYYY") {
      return moment(stamp).format(str);
    },
    formatYearMonthDay(src) {
      return moment(src).format("YYYY-MM-DD HH:mm");
    },
    // 新增
    addEquipment() {
      //新增弹框标题
      this.Release = true;
    },
    //驳回
    returnRow(rows) {
      console.log(rows);
      this.ids = rows.examineId;
      this.dialogStatus = "editEquipment";
      this.Release2 = true;
    },
    add(rows) {
      console.log(rows);
      this.dialogStatus = "addEquipment";
      this.Release2 = true;
      this.ids = rows.examineId;
    },
    //查看意见
    lookRow1(e) {
      console.log(e);
      this.dialogStatus3 = "addEquipment";
      this.Release3 = true;
      this.formLabelAlign.num = e.examineScore;
      this.formLabelAlign.yijian = e.content;
      //   formLabelAlign: { num: "", yijian: "", yuanyin: "" },
    },
    //查看yuanyin
    lookRow2(e) {
      console.log(e);
      this.dialogStatus3 = "editEquipment";
      this.Release3 = true;
      this.formLabelAlign.num = e.examineScore;
      this.formLabelAlign.yuanyin = e.content;
      //   formLabelAlign: { num: "", yijian: "", yuanyin: "" },
    },
    // 表格内删除按钮的点击事件
    deleteRow(rows) {
      const ids = rows.id;
      this.$confirm("此操作将删除该项, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(res1 => {
          console.log(ids);
          deleteShenBao(ids).then(res => {
            if (res.code == 0) {
              this.$message.success("删除成功");
              const totalPage = Math.ceil((this.total - 1) / this.pageSize);
              // 记住删除最后一条数据时当前码是最后一页
              const pageNums =
                this.pageNum > totalPage ? totalPage : this.pageNum;
              // 重新记录当前页码
              this.pageNum = pageNums < 1 ? 1 : pageNums;
              //删除成功 回调列表接口
              this.getList();
            } else {
              this.$message.error(res.msg);
            }
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除"
          });
        });
    },
    //切换每页条数容量
    handleSizeChange(val) {
      this.pageSize = val;
      this.getList(this.pageNum, this.pageSize);
    },
    //切换当前页
    handleCurrentChange(val) {
      this.pageNum = val;
      this.getList(this.shenPi);
    },
    //获取表格数据
    getList(shenPi) {
      console.log(shenPi);
      const params = {
        openId: shenPi.id,
        pageNum: this.pageNum,
        pageSize: this.pageSize
      };
      getGuanLi(params)
        .then(res => {
          console.log(res);
          this.tableData = res.data.reverse();
          this.total = res.total; //总条数
          let arr = [];
          res.data.forEach(item => {
            arr.push(item.personTechnical);
          });
          this.personTechnicalList = arr;
        })
        .catch(e => {
          console.log(e);
        });
    },
    //搜索
    async sousuo() {
      const params = {
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        approveStatus: this.statusd,
        personName: this.names
      };
      console.log(params);
      const res = await getGuanLi(params);
      if (res.code == 0) {
        console.log(res);
        this.tableData = res.data.reverse();
        this.total = res.total; //总条数
      }
    },
    changeData(flag) {
      if (flag) {
        if (this.ruleForm.endTime) {
          if (this.ruleForm.beginTime > this.ruleForm.endTime) {
            this.ruleForm.beginTime = null;
            this.$message.error("开始时间不能大于结束时间！");
          }
        }
      } else {
        if (this.ruleForm.beginTime) {
          if (this.ruleForm.beginTime > this.ruleForm.endTime) {
            this.ruleForm.endTime = null;
            this.$message.error("结束时间不能小于开始时间！");
          }
        }
      }
    },
    // 通过审核确认
    async submitForm2() {
      this.$confirm("确认提交吗, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(res1 => {
          const kyPersonExamine = {
            // openId: this.opensid,
            approveResult: 0,
            approveStatus: 1,
            content: this.formLabelAlign.yijian,
            examineScore: this.formLabelAlign.num,
            examineId: this.ids
          };

          tongGuanLi(kyPersonExamine).then(res => {
            if (res.code == 0) {
              this.$message.success("审核成功");
              this.Release2 = false;
              this.getList(this.shenPi); //获取表格数据
              this.formLabelAlign = { num: "", yijian: "", yuanyin: "" };
            } else {
              this.$message.error(res.msg);
            }
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消"
          });
        });
      // formLabelAlign: { num: "", yijian: "", yuanyin: "" }
    },
    // 驳回审核确认
    async submitForm3() {
      this.$confirm("确认提交吗, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(res1 => {
          const kyPersonExamine = {
            // openId: this.opensid,
            approveResult: 1,
            approveStatus: 1,
            content: this.formLabelAlign.yuanyin,
            // examineScore: this.formLabelAlign.num,
            examineId: this.ids
          };
          returnGuanLi(kyPersonExamine).then(res => {
            if (res.code == 0) {
              this.$message.success("已驳回");
              this.Release2 = false;
              this.getList(this.shenPi); //获取表格数据
              this.formLabelAlign = { num: "", yijian: "", yuanyin: "" };
            } else {
              this.$message.error(res.msg);
            }
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消"
          });
        });
      // formLabelAlign: { num: "", yijian: "", yuanyin: "" }
    },
    async submitForm() {
      const kyPersonExamine = {
        openId: this.opensid,
        approveResult: this.applayList.approveResult,
        approveStatus: this.applayList.approveStatus,
        content: this.applayList.content,
        examineScore: this.applayList.examineScore,
        examineYear: this.getFormatedTimeStr(this.year),
        examineAchievementName: JSON.stringify(this.applayList[0].data)
      };
      console.log(kyPersonExamine);
      const res = await addTianBao(kyPersonExamine);
      if (res.code == 0) {
        this.$message.success("提交成功");
        this.$emit("fatherMethod1");
        this.Release = false;
        this.getList();
        this.applayList = [
          {
            approveResult: "",
            approveStatus: "",
            content: "",
            examineScore: "",
            examineYear: "",
            data: [
              {
                id: 1,
                examineAchievementName: "",
                examineAchievementType: "",
                examineAppendixUrl: []
              }
            ]
          }
        ];
      } else {
        this.$message.error("提交失败");
        this.Release = false;
      }
      console.log(res);
      // console.log(this.applayList);
    },
    closeTargets() {
      this.Release = false;
      this.applayList = [
        {
          approveResult: "",
          approveStatus: "",
          content: "",
          examineScore: "",
          examineYear: "",
          data: [
            {
              id: 1,
              examineAchievementName: "",
              examineAchievementType: "",
              examineAppendixUrl: []
            }
          ]
        }
      ];
    },
    closeTargets2() {
      this.Release2 = false;
      this.formLabelAlign = { num: "", yijian: "", yuanyin: "" };
    },
    closeTargets3() {
      this.Release3 = false;
      this.formLabelAlign = { num: "", yijian: "", yuanyin: "" };
    }
  }
};
</script>

<style lang="scss" scoped>
.app-container {
  height: 100%;
  background-color: #f4f5fc;
}

.createMUban {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ensemble {
  height: 50px;
  width: 100%;
  margin-bottom: 0.5%;
}

/* 共同样式 */
.add_dimension {
  color: blue;
}

.delete_dimension {
  color: red;
}

.add_dimension:hover {
  color: rgb(72, 72, 234);
}

.delete_dimension:hover {
  color: rgb(245, 71, 71);
}

.nextOne {
  margin-top: 25px;
  margin-left: 45%;
  background-color: #0096fe;
}

::v-deep .el-dialog__footer {
  /*width: 0;宽度为0隐藏*/
  text-align: center;
}

// 滚动条样式
::v-deep .el-table__body-wrapper {
  &::-webkit-scrollbar {
    // 整个滚动条
    width: 0; // 纵向滚动条的宽度
    background: rgba(213, 215, 220, 0.3);
    border: none;
  }

  &::-webkit-scrollbar-track {
    // 滚动条轨道
    border: none;
  }
}

::v-deep .el-input__inner {
  height: 32px;
}

::v-deep .el-dialog__header {
  background-color: #ecf1f9;
  border-radius: 10px;
}

::v-deep .el-dialog {
  border-radius: 10px;
}

::v-deep .el-tooltip__popper {
  max-width: 10%;
}

::v-deep .el-tooltip__popper,
.el-tooltip__popper.is-dark {
  background: rgb(48, 65, 86) !important;
  color: #fff !important;
  line-height: 24px;
}

::v-deep .el-table--scrollable-y .el-table__body-wrapper {
  overflow-y: auto;
}

::v-deep .el-table th.gutter {
  display: none;
  width: 0;
}

::v-deep .el-table colgroup col[name="gutter"] {
  display: none;
  width: 0;
}

::v-deep .el-table__body {
  width: 100% !important;
}

::v-deep [data-v-125ad6e6] .el-step.is-horizontal .el-step__line {
  opacity: 0;
}
</style>
